package com.iplay.thezen.templateMethod;

/**
 * @author dangwu
 * @since 2021/9/9 4:45 下午
 */
public abstract class AbstractClass {
    //基本方法
    protected abstract void doSomething();
    protected abstract void doAnything();
    protected abstract void alarm();
    //模板方法
     final public void templateMethod(){
        this.doAnything();
        this.doSomething();
        if (this.isAlarm()){
            this.alarm();
        }
    }

    protected boolean isAlarm(){
        return true;
    }
}
